<template>
    <div class="g-height100 g-width100">
        <TaskListComponent ref="taskListCom" bus-key="taskUnreachableManageList"
                           :table-columns="columns"
                           model-type="runtime"
                           :table-operations="tableOperations"
                           :list-url="$baseURL.workflow +  '/workflow/task/tasks/unreachable/listPage'">

        </TaskListComponent>


        <!-- 任务分配弹窗 -->
        <TaskAssignDialog ref="taskAssignDialog" :task-id="taskAssignDialog.taskId"
                          :on-success="()=>{$refs.taskListCom.getTableRef().refreshData()}"
                          :form-item-assign-me="taskAssignDialog.formItemAssignMe"></TaskAssignDialog>

    </div>

</template>

<script>

    import TaskListComponent from '../../components/task/TaskListComponent.vue'
    import TaskAssignDialog from '../../components/task/TaskAssignDialog.vue'

    export default {
        components:{
            TaskListComponent,
            TaskAssignDialog,
        },
        data(){
            return {
                columns:[
                    {
                        prop: 'businessKey',
                        label:'业务编号'
                    },
                    {
                        prop: 'taskName',
                        label:'任务名称'
                    },
                    {
                        prop: 'processDefinitionName',
                        label:'流程名称'
                    },
                    {
                        prop: 'processStartAtTxt',
                        label:'流程启动时间'
                    },
                    {
                        prop: 'taskCreateTimeStr',
                        label:'任务开始时间'
                    },
                    {
                        prop: 'firstCommentMessage',
                        label:'评论'
                    }
                ],
                tableOperations:[
                    {
                        action: this.showTaskAssignDialog,
                        disabledOnMissingSelect:true,
                        label:'分配任务'
                    }
                ],
                taskAssignDialog:{
                    taskId: null,
                    formItemAssignMe: true
                }
            }
        },
        methods:{
            showTaskAssignDialog(row){
                this.taskAssignDialog.taskId = row.taskId
                this.$refs.taskAssignDialog.show()
            }
        }
    }
</script>

<style scoped>

</style>